package com.amos.teaching_aids.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import com.amos.teaching_aids.R;
import com.amos.teaching_aids.UserInfo;
import com.amos.teaching_aids.ui.activity.UserInfoActivity;

import java.util.List;
import java.util.Objects;

/**
 * Created by Administrator on 2016/10/10 0010.
 */

public class AdapterUser extends AdapterBase {

    public AdapterUser(Context context, int[] layoutResArrays, List data) {
        super(context, layoutResArrays, data);
    }

    @Override
    protected void convert(ViewHolderHelper helper, Object item) {
        View view = helper.getView();
        helper.setClickListener(R.id.user_item, new UserInfoActivity().listener);
        TextView userInfoItem = (TextView) view.findViewById(R.id.item_name);
        TextView userInfo = (TextView)view.findViewById(R.id.item_value);
        UserInfo user= (UserInfo) item;
        userInfoItem.setText(user.getItem());
        userInfo.setText(user.getValue());

    }
}
